PHP text encoding transformation using SJIS-win rather than SJIS, using eucJP-win rather than EUC-JP using SJIS-win rather than SJIS, use eucJP-win instead of EUC-JPFrom: pentan.infophpsjiswin_eucjpwin.html to specify the text encoding
"Translate" PHP with text encoding transforms using Sjis-win instead of Sjis, using Eucjp-win rather than EUC-JP
Using Sjis-win instead of Sjis, use Eucjp-win instead of EUC-JP
From:http://pentan.info/php/sjiswin_eucjpwin.html
In the designation of
Mb_convert_encoding (Addslashes ($u [+]), ' UTF-8 ', ' iso-8859-15,shift-jis,eucjp-win,sjis-win,iso-8859-1,utf-8 ')
This transcoding only the first valid, such as the first one is iso-8859-15, Western European code can be converted, but the
These character sets are especially helpful when it comes to the various words, punctuation, and special symbols of the Japanese character set.
UTF8
[\x01-\x7f]| [\XC0-\XDF] [\x80-\xbf]| [\xe0-\xef] [\X80-\XBF] {2}| [\xf0-\xff] [\X80-\XBF] {3}
UTF16
These character sets are especially helpful for the various characters, punctuation marks, and special characters of Japanese character sets.
UTF8
[\ X01-\ x7f] | [\ xc0-\ xdf] [\ x80-\ xbf] | [\ xe0-\ xef] [\ x80-\ xbf] {2} | [\ xf0-\ xff] [\ x80-\
A small program is being written Miniblogs updater, you need to calculate the number of words entered by the user. Because the length of the Chinese-English character encoding is different, if you use the Len () function in Python, it calculates the
These character sets are especially helpful for the various characters, punctuation marks, and special characters of Japanese character sets.UTF8[\ X01-\ x7f] | [\ xc0-\ xdf] [\ x80-\ xbf] | [\ xe0-\ xef] [\ x80-\ xbf] {2} | [\ xf0-\ xff] [\ x80-\
Mb_convert_encoding is used to convert the encoding. I have never understood the concept of program encoding, but now it seems a bit open. However, the English language generally does not have Encoding Problems. Only Chinese data can have this
For example, when you use Zend Studio or Editplus to write a program, you use gbk encoding. If the data needs to be imported into the database and the database is encoded as utf8, you need to encode and convert the data, otherwise, the database will
If you need to know how to match Chinese characters in Python, we must first look at the following table
UTF8[x01-x7f]| [XC0-XDF] [x80-xbf]| [Xe0-xef] [X80-XBF] {2}| [Xf0-xff] [X80-XBF] {3}UTF16[X00-xd7] [xe0-xff]| [XD8-XDF] [X00-xff]
Mb_convert_encoding This function is used to convert the encoding. It turns out that the concept of program coding is not understood, but it seems to be a bit enlightened now. However, there is generally no coding problem in English, only the
When crawling Web pages in PHP, you often need to encode the URL, and then use two functionsmb_detect_encoding - detects the encoding of a character. mb_convert_encoding - encoding of converted characters?
1 2 3 4 5 6 7 8 9 10 11 12 1
Coding in PHP has always been a headache for developers, but if the sweet some useful functions are different, let's introduce a processing function for a Chinese encoding.
Mb_convert_encoding ($str, $encoding 1, $encoding 2)
$str, to convert the
Example of character encoding conversion function usage in PHP, php example
In this paper, the use of the character encoding conversion function in PHP is described and shared for everyone's reference. The implementation method is as follows:
In
This article describes how to solve the problem of truncation characters during iconv function transcoding in PHP. the solution provided in this article is to use mb_convert_encoding instead of iconv, if you need iconv, refer to iconv conversion
Php code conversion function. Generally, iconv is used. the mb_convert_encoding function is used only when the encoding of the original encoding cannot be determined or The iconv cannot be normally displayed after conversion. Iconv function syntax:
If the output encoding format does not contain any character, you can search for the replacement character in the similar encoding; 'ignore': If the output encoding format does not contain a character in the string, it can skip encoding of
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.